package com.cac.demo.dao.outBill;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface WmsInvOutBillHDao {
    //进行出库操作时根据表单数据插入出库申请单主表
    public int insertWmsInvOutBillH(@Param("map") Map map, @Param("wmsInvOutBillHId") String wmsInvOutBillHId);

    //批量出库，将数据插入到出库申请表主表
    public int insertWmsInvOutBillHMany(List<Map> maps);

    //时插入占用表
    public int createOutAllotment(@Param("map") HashMap map);
    //分拣保存时插入出库主表
    public int createOutBillH(@Param("map") HashMap map);
    //更新台账占用信息
    public int updateItemInventory(@Param("map")HashMap map);
    //分拣占用
    public HashMap sortingAllot(@Param("map")HashMap map);
    //拆包占用
    public List<HashMap> unpackAllot(@Param("map")HashMap map);
    //查询AO_No
    public HashMap searchAoNo(@Param("map")HashMap map);
    //分拣出库
    public HashMap sortingInvOut(@Param("map")HashMap map);
    //分拣占用取消
    public HashMap sortingAllotCancel(@Param("map")HashMap map);
    //分拣出库撤销
    public HashMap sortingInvOutCancel(@Param("map")HashMap map);
    //ERP出库流水表保存
    public int erpOutOccupyTransaction(@Param("map")HashMap map);
    //ERP出库——更新台账表
    public int erpOutOccupyInventory(@Param("map")HashMap map);
    //查询ERP出库的缓存箱以及出库的数量(存在单个缓存箱大于出库数量)
    HashMap outWorkbinQty(@Param("map")HashMap map);
    //查询ERP出库的缓存箱以及出库的数量(单个缓存箱数量小于出库数量)
    List<HashMap> outWorkbinLessQty(@Param("map")HashMap map);
    //
    int insertErpOutBill(@Param("map")HashMap map);
    //ERP出库——更新库存表
    public int erpOutWorkbinMaterial(@Param("map")HashMap map);

    //ERP出库占用——插入出库申请主表
    public int erpOutOccupyOutBillH(@Param("map")HashMap map);
    //ERP出库占用——插入出库申请子表
    public int erpOutOccupyOutBillL(@Param("map")HashMap map);
    //ERP出库占用——插入占用表
    public int erpOutOccupyAllotment(@Param("map")HashMap map);
    //ERP出库占用——修改台账表
    public int erpUpdateInventory(@Param("map")HashMap map);
    //ERP出库占用取消——修改台账信息
    int updateItemInventoryCancel(@Param("map")HashMap map);
    //ERP出库占用取消
    public int InvOutAllotCancel(@Param("map")HashMap map);
    //ERP出库占用取消——删除出库子表
    public int DeleteOutBillL(@Param("map")HashMap map);
    //ERP出库占用取消——删除出库主表
    public int DeleteOutBillH(@Param("map")HashMap map);
    //ERP出库撤销——更改流水表数据
    public int erpOutOccupyCancel(@Param("map")HashMap map);
    //ERP出库撤销——修改台账表数据
    public int updateInventory(@Param("map")HashMap map);

    int searchItemInventoryExists(@Param("map")HashMap map);

    //判断判断出库主表存不存在
    String isOutBillH(@Param("map")HashMap map);

    //判断流水表存不存出库占用信息
    String isTransAllot(@Param("map")HashMap map);

    //判断有无出库占用信息
    String isOutAllot(@Param("map")HashMap map);

    //判断有无出库撤销信息
    String isOutCancel(@Param("map")HashMap map);

    //判断有无出库信息
    String isTransOut(@Param("map")HashMap map);

    //查询需要还原的台账id
    List<HashMap> backWmsInventory(@Param("map")HashMap map);

    //查找该台账下需要恢复的缓存箱数据
    List<HashMap> backWorkbin(@Param("map")HashMap map);

    //恢复缓存箱数据
    int updateWorkbin(@Param("map")HashMap map);

    //废除erp出库表中数据
    int repealErpWorkbin(@Param("map")HashMap map);

    //查询需要还原的台账id
    List<HashMap> backInventoryIds(@Param("map")HashMap map);

    //查询需要取消占用的台账id
    HashMap inventoryCancelIds(@Param("map")HashMap map);
}
